var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        }),
    r = function (e, t, o, n) {
        var i,
            a = arguments.length,
            r = a < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n);
        else
            for (var s = e.length - 1; s >= 0; s--)
                (i = e[s]) && (r = (a < 3 ? i(r) : a > 3 ? i(t, o, r) : i(t, o)) || r);
        return a > 3 && r && Object.defineProperty(t, o, r), r;
    };
Object.defineProperty(i, "__esModule", {value: !0});
var s = e("AssetsMap"),
    c = e("GameModuleViewMediator"),
    l = e("GameData"),
    d = (window.wx, cc._decorator),
    u = d.ccclass,
    p = d.property,
    h = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.btn_back = null), (t.btn_look = null), (t.snakeName = ""), (t.isLookAd = !1), t;
        }
        return (
            a(t, e),
            (t.prototype.onResetView = function () {
                e.prototype.onResetView.call(this), this.init();
            }),
            (t.prototype.init = function () {
                (this.snakeName = this.param.snakeName),
                    ad.adInterface.isNativePatchReady() &&
                        (game.UIManager.instance.showToast("贴片准备ok"),
                        ad.adInterface.showNativePatch("NativePatch_4"));
            }),
            (t.prototype.onDisable = function () {}),
            (t.prototype.addEvent = function () {
                this.btn_back.on(game.EngineEventType.NodeEvent.click, this.onClick_btn_back, this),
                    this.btn_look.on(game.EngineEventType.NodeEvent.click, this.onClick_btn_look, this);
            }),
            (t.prototype.removeEvent = function () {
                this.btn_back.off(game.EngineEventType.NodeEvent.click, this.onClick_btn_back, this),
                    this.btn_look.off(game.EngineEventType.NodeEvent.click, this.onClick_btn_look, this);
            }),
            (t.prototype.onClick_btn_back = function () {
                game.AudioManager.playBtnEffect(),
                    this.closeView(!1),
                    game.PopupManager.instance.showPopView(s.default.PopupMap.ProgressTaskView, null, !1, !1);
            }),
            (t.prototype.onClick_btn_look = function () {
                game.AudioManager.playBtnEffect();
                var e = this;
                ad.adInterface.showRewardedVideo(
                    function () {
                        (e.isLookAd = !0), (l.default.instance.gameState = l.GameState.stop);
                    },
                    function () {
                        e.isLookAd = !1;
                    },
                    function () {
                        l.default.instance.againPlayTimes++,
                            e.closeView(!1),
                            (l.default.instance.gameState = l.GameState.play),
                            game.appFacade.sendNotification(c.default.PlayAgain, {snakeName: e.snakeName});
                    }
                );
            }),
            r([p(cc.Node)], t.prototype, "btn_back", void 0),
            r([p(cc.Node)], t.prototype, "btn_look", void 0),
            r([u], t)
        );
    })(game.BasePopView);
i.default = h;
